# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=librelp
pkgver=1.11.0
pkgrel=2
pkgdesc="The Reliable Event Logging Protocol library"
url="https://www.rsyslog.com"
arch="all"
license="GPL-3.0-or-later"
makedepends="gnutls-dev openssl-dev>3"
checkdepends="bash coreutils"
subpackages="$pkgname-static $pkgname-dev"
source="https://download.rsyslog.com/librelp/librelp-$pkgver.tar.gz
	implicit-decl.patch
	"
options="!check" # XXX: some fail in CI, don't know why

prepare() {
 	default_prepare
	update_config_sub
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--mandir=/usr/share/man \
		--enable-valgrind=no
	make
}

check() {
	make -j1 check || {
		cat tests/test-suite.log
		return 1
	}
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
e93cbc12fb6e596762c351cdfa3293fea89dd8cf90de4f890771216b56c3f66e3578fefea447d4ca9f754f146712481e7bab9a831f16fcf0cd15b10d475925bc  librelp-1.11.0.tar.gz
706447c06fe5a9d5d2f55093c692142884bd6802eb3be51214c356c00d210681d5ce2d33485e6f22edd2bb8113cf63318880cbfca193ea686626e5c23eb941a6  implicit-decl.patch
"
